<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
mysql_connect("localhost","root","root");
mysql_select_db("interfacetest");
$getquestioninfo = "SELECT * FROM questioninfo"; 
$rs1 = mysql_query($getquestioninfo);                     //获取数据集
if(!$rs1){die("Valid result!");}
while($row=mysql_fetch_row($rs1))
{
	echo "编号：    ".$row[0]."<br>";
    echo "提问标题：    ".$row[1]."<br>";
    echo "提问内容：    ".$row[2]."<br>";
    echo "提问用户：    ".$row[3]."<br>";
    echo "提问日期：    ".$row[4]."<br>";
    echo "关键词1：    ".$row[5]."<br>";
    echo "关键词2：    ".$row[6]."<br>";
    echo "关键词3：    ".$row[7]."<br>";
    echo "关键词4：    ".$row[8]."<br>";
    $getanswernum = "select count(*) from answer where questionid like $row[0]";
    $rs2 = mysql_query($getanswernum);
    $row2=mysql_fetch_row($rs2);
    echo "人气：    ".$row2[0]."<br>";
    mysql_free_result($rs2);
    echo "<br>";
}
mysql_free_result($rs1);
?>